package com.gdqy.FCS.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gdqy.FCS.common.service.BaseService;
import com.gdqy.FCS.dao.UserDao;
import com.gdqy.FCS.entity.User;

@Service
@Transactional
public class UserService extends BaseService {

	@Autowired
	UserDao userDao;
	
	public List<User> selectAll() {
		return userDao.selectAll();
	}

	public User selectByName(String name) {
		return userDao.selectByName(name);
	}

	public int insert(User user){
		int i = userDao.insert(user);
		System.out.println(i);
		return i;
	}
	
	public User selectByEmail(String email){
		return userDao.selectByEmail(email);
	}
	
	public int update(User user){
		 return userDao.update(user);
	}
	
	public int delete(User user){
		return userDao.delete(user);
		
	}
	public User selectById(int id){
		return userDao.selectById(id);
	}
}
